-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c++11 compatibility #6
Conversation
I think I should accept it. I was against it due to added overhead in maintenance but is does not look too much right now and fs does not add any value at all here right now. But before accepting it I would like some minor (formatting nitpick) changes. Thank you! |
cr.h
Outdated
static void cr_split_path(std::string path, std::string &parent_dir, | ||
std::string &base_name, std::string &ext) { | ||
#if _WIN32 | ||
std::replace(path.begin(), path.end(), '/', CR_SEPARATOR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use another define for the character being replaced with the one in 376-380 and avoid this ifdef here, something like: CR_INVALID_SEPARATOR or CR_FROM_SEPARATOR.
cr.h
Outdated
std::unique_ptr<wchar_t[]> wpath_big; | ||
wchar_t* wpath = wpath_small; | ||
if (wlen > _countof(wpath_small)) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried to run clang-format? I'm not sure if I've let it misconfigured or if it does not support it, I can't remember.
But { should be in the same line, also, any block even one-liners as in L493 should go inside braces, there are some if and a while without braces. So if you can fix it I'll be glad! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah i used clang-format, but did these changes after. Will fix it. Although clang-format does quite a lot of other changes that i found surprising arent already in the repository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I need check my clang-config and travis config anyway.
Just to note, you've missed some ifs and while without braces elsewhere. :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean ones with one line bodies? clang-format isnt adding braces to these. Should i?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I think this case is unsupported by clang-format. Thanks, I'll push his when I'll get at home.
… to support compiling with older compilers.
Replaced c++17 std::filesystem usage with platform api calls in order to support compiling with older compilers.